package com.yeskery.nut.extend.mcp.server;

import com.yeskery.nut.core.NutException;
import com.yeskery.nut.extend.mcp.core.JsonError;

/**
 * Mcp异常
 * @author sprout
 * 2025-04-17 15:10
 */
public class McpException extends NutException {
    /** 异常信息 */
    private final JsonError jsonError;

    /**
     * 构造Mcp异常
     * @param jsonError 异常信息
     */
    public McpException(JsonError jsonError) {
        super(jsonError.getMessage());
        this.jsonError = jsonError;
    }

    /**
     * 获取异常信息
     * @return 异常信息
     */
    public JsonError getJsonError() {
        return jsonError;
    }
}
